package com.ryskoo.customer.customerintegral.service;

import com.ryskoo.customer.customerintegral.domain.CustomerIntegralPO;
import com.ryskoo.framework.core.service.IBasicService;

import java.util.Map;

/**
 * @author BeHappy
 */
public interface ICustomerIntegralService extends IBasicService<CustomerIntegralPO> {
    /**
     * 获取会员积分
     * @param customerUuid
     * @param vendorUuid
     * @return
     */
    CustomerIntegralPO getIntegral(String customerUuid, String vendorUuid);

    /**
     * 赠送积分
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param giveIntegral
     * @param type
     */
    void add(String customerUuid, String vendorUuid, String orderId, int giveIntegral, int type);

    /**
     * 使用积分
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param useIntegral
     * @param type
     */
    void use(String customerUuid, String vendorUuid, String orderId, int useIntegral, int type);

    /**
     * 下单赠送积分
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param giveIntegral
     */
    void addByOrder(String customerUuid, String vendorUuid, String orderId, int giveIntegral);

    /**
     * 订单评价赠送积分
     *
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param giveIntegral
     */
    public void addByAppraise(String customerUuid, String vendorUuid, String orderId, int giveIntegral);
    
    /**
     * 取消订单退还使用的积分
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param useIntegral
     */
    void addByCancelOrder(String customerUuid, String vendorUuid, String orderId, int useIntegral);

    /**
     * 下单使用积分
     * @param customerUuid
     * @param vendorUuid
     * @param orderId
     * @param useIntegral
     */
    void useByOrder(String customerUuid, String vendorUuid, String orderId, int useIntegral);


    /**
     * 查询会员积分、消费次数、消费金额
     * @param customerUuid
     * @param vendorUuid
     * @return
     */
    Map<String,Object> getStatistics(String customerUuid, String vendorUuid);

}
